package com.ep.commonrecycleviewadapter.testmulti;


import com.ep.commonrecycleviewadapter.ChatMessage;
import com.ep.commonrecycleviewadapter.R;
import com.ep.commonrecycleviewadapter.base.ItemViewDelegate;
import com.ep.commonrecycleviewadapter.base.ViewHolder;

/**
 * Created by Administrator on 2017/7/31.
 */

public class RightItemViewDelegate implements ItemViewDelegate<ChatMessage> {
    @Override
    public int getItemViewLayoutId() {
        return R.layout.adapter_multi_right_item;
    }

    @Override
    public boolean isForViewType(ChatMessage data, int postiton) {
        return !data.isComMeg();

    }

    @Override
    public void bindData(ViewHolder viewHolder, ChatMessage data, int position) {
        viewHolder.setText(R.id.chat_send_content, data.getContent());
        viewHolder.setText(R.id.chat_send_name, data.getName());
        viewHolder.setImageResource(R.id.chat_send_icon, data.getIcon());
    }
}
